| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import Link from "next/link";
- import { auth } from "~/server/auth";
- import { db } from "~/server/db";
- import { Bell } from "lucide-react";
- import {
- Card,
- CardDescription,
- CardHeader,
- CardTitle,
- } from "~/components/ui/card";
- /**
- * Centre de notifications in-app, complément aux emails envoyés aux transformateurs.
- */
- export default async function NotificationsPage({
- params,
- }: {
- params: Promise<{ workspaceId: string }>;
- }) {
- const { workspaceId } = await params;
- const session = await auth();
- if (!session?.user?.id) {
- return null;
- }
- const workspace = await db.workspace.findFirst({
- where: {
- id: workspaceId,
- ownerId: session.user.id,
- },
- select: { id: true },
- });
- if (!workspace) {
- return (
- <main className="flex min-h-[40vh] flex-col items-center justify-center p-4">
- <p className="text-destructive">Workspace non trouvé</p>
- <Link href="/" className="mt-4 text-primary underline">
- Retour
- </Link>
- </main>
- );
- }
- return (
- <main className="mx-auto max-w-lg p-4 pb-16 pt-6 sm:p-6">
- <div className="mb-6 flex items-center gap-3">
- <div className="flex size-11 items-center justify-center rounded-xl bg-primary/10">
- <Bell className="size-5 text-primary" aria-hidden />
- </div>
- <div>
- <h1 className="text-lg font-semibold tracking-tight">
- Notifications
- </h1>
- <p className="text-sm text-muted-foreground">
- Historique des alertes dans l'application.
- </p>
- </div>
- </div>
- <Card>
- <CardHeader>
- <CardTitle>Aucune alerte locale pour le moment</CardTitle>
- <CardDescription>
- Les emails (nouvelle idée, réponses qualification, etc.) continuent d'
- être envoyés selon votre configuration. Une liste dans l'app sera ajoutée
- prochainement. Le résumé des nouvelles idées et réponses s'
- affiche aussi sur votre backlog.
- </CardDescription>
- </CardHeader>
- </Card>
- <p className="mt-6 text-center text-sm">
- <Link
- href={`/workspace/${workspaceId}/backlog`}
- className="text-primary underline-offset-4 hover:underline"
- >
- Ouvrir le backlog
- </Link>
- </p>
- </main>
- );
- }
|